LanguageExt.Core

LanguageExt.Core Effects Eff Eff no runtime

Contents

Sub modules

Extensions
Operators
Prelude

record Eff <A> (Eff<MinRT, A> effect) Source #

This monad is used to encapsulate side effects and exception capture

Parameters

type RT

Runtime type

type A

Bound value type

Methods

method Eff<A> Pure (A value) Source #

Lift a value into the Eff monad

method Eff<A> Fail (Error error) Source #

Lift a failure into the Eff monad

method Eff<RT, A> WithRuntime <RT> () Source #

Convert to an Eff monad with a runtime

method Eff<A> Lift (Func<MinRT, Either<Error, A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> Lift (Func<MinRT, Fin<A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> Lift (Func<MinRT, A> f) Source #

Lift an effect into the Eff monad

method Eff<A> LiftIO (Func<MinRT, Task<A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> LiftIO (Func<MinRT, Task<Fin<A>>> f) Source #

Lift an effect into the Eff monad

method Eff<A> LiftIO (Func<MinRT, IO<A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> LiftIO (IO<A> ma) Source #

Lift an effect into the Eff monad

method Eff<A> Lift (Func<Either<Error, A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> Lift (Func<Fin<A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> Lift (Func<A> f) Source #

Lift an effect into the Eff monad

method Eff<A> LiftIO (Func<Task<A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> LiftIO (Func<Task<Fin<A>>> f) Source #

Lift an effect into the Eff monad

method Eff<B> Map <B> (Func<A, B> f) Source #

Maps the Eff monad if it's in a success state

Parameters

param f

Function to map the success value with

returns

Mapped Eff monad

method Eff<B> Select <B> (Func<A, B> f) Source #

Maps the Eff monad if it's in a success state

Parameters

param f

Function to map the success value with

returns

Mapped Eff monad

method Eff<A> MapFail (Func<Error, Error> f) Source #

Maps the Eff monad if it's in a success state

Parameters

param f

Function to map the success value with

returns

Mapped Eff monad

method Eff<B> MapIO <B> (Func<IO<A>, IO<B>> f) Source #

Maps the inner IO monad

Parameters

param f

Function to map with

returns

Mapped Eff monad

method Eff<B> BiMap <B> (Func<A, B> Succ, Func<Error, Error> Fail) Source #

Mapping of either the Success state or the Failure state depending on what state this Eff monad is in.

Parameters

param Succ

Mapping to use if the Eff monad if in a success state

param Fail

Mapping to use if the Eff monad if in a failure state

returns

Mapped Eff monad

method Eff<B> Match <B> (Func<A, B> Succ, Func<Error, B> Fail) Source #

Pattern match the success or failure values and collapse them down to a success value

Parameters

param Succ

Success value mapping

param Fail

Failure value mapping

returns

IO in a success state

method Eff<A> IfFail (Func<Error, A> Fail) Source #

Map the failure to a success value

Parameters

param f

Function to map the fail value

returns

IO in a success state

method Eff<A> IfFailEff (Func<Error, Eff<A>> Fail) Source #

Map the failure to a new IO effect

Parameters

param f

Function to map the fail value

returns

IO that encapsulates that IfFail

method Eff<A> Filter (Func<A, bool> predicate) Source #

Only allow values through the effect if the predicate returns true for the bound value

Parameters

param predicate

Predicate to apply to the bound value>

returns

Filtered IO

method Eff<A> Where (Func<A, bool> predicate) Source #

Only allow values through the effect if the predicate returns true for the bound value

Parameters

param predicate

Predicate to apply to the bound value>

returns

Filtered IO

method Eff<B> Bind <B> (Func<A, Eff<B>> f) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param f

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<B> Bind <B> (Func<A, IO<B>> f) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param f

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<B> Bind <B> (Func<A, Ask<MinRT, B>> f) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param f

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<RT, B> Bind <RT, B> (Func<A, Eff<RT, B>> f) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param f

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<RT, B> Bind <RT, B> (Func<A, K<Eff<RT>, B>> f) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param f

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<B> Bind <B> (Func<A, K<Eff, B>> f) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param f

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<B> Bind <B> (Func<A, Pure<B>> f) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param f

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<A> Bind (Func<A, Fail<Error>> f) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param f

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<C> SelectMany <B, C> (Func<A, Eff<B>> bind, Func<A, B, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<RT, C> SelectMany <RT, B, C> (Func<A, Eff<RT, B>> bind, Func<A, B, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<RT, C> SelectMany <RT, B, C> (Func<A, K<Eff<RT>, B>> bind, Func<A, B, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<C> SelectMany <B, C> (Func<A, K<Eff, B>> bind, Func<A, B, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<C> SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<C> SelectMany <B, C> (Func<A, Ask<MinRT, B>> bind, Func<A, B, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<C> SelectMany <B, C> (Func<A, Fail<Error>> bind, Func<A, B, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<C> SelectMany <C> (Func<A, Guard<Error, Unit>> bind, Func<A, Unit, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method Eff<C> SelectMany <C> (Func<A, Guard<Fail<Error>, Unit>> bind, Func<A, Unit, C> project) Source #

Monadic bind operation. This runs the current Eff monad and feeds its result to the function provided; which in turn returns a new Eff monad. This can be thought of as chaining IO operations sequentially.

Parameters

param bind

Bind operation

returns

Composition of this monad and the result of the function provided

method string ToString () Source #

method Eff<A> Success (A value) Source #

Lift a value into the Eff monad

method Eff<A> Effect (Func<A> f) Source #

Lift a synchronous effect into the Eff monad

method Eff<A> EffectMaybe (Func<Fin<A>> f) Source #

Lift a synchronous effect into the Eff monad

class Eff Source #

Methods

method Eff<A> Success <A> (A value) Source #

Construct a successful effect with a pure value

Parameters

type A

Bound value type

param value

Pure value to construct the monad with

returns

Synchronous IO monad that captures the pure value

method Eff<A> Fail <A> (Error error) Source #

Construct a failed effect

Parameters

type A

Bound value type

param error

Error that represents the failure

returns

Synchronous IO monad that captures the failure

method Eff<Unit> unit () Source #

Unit effect

method Eff<A> localCancel <A> (Eff<A> ma) Source #

Create a new cancellation context and run the provided Aff in that context

Parameters

type RT

Runtime environment

type A

Bound value type

param ma

Operation to run in the next context

returns

An asynchronous effect that captures the operation running in context

method Eff<A> lift <A> (Func<Either<Error, A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> lift <A> (Func<Fin<A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> lift <A> (Func<A> f) Source #

Lift an effect into the Eff monad

method Eff<A> lift <A> (Func<Task<A>> f) Source #

Lift an effect into the Eff monad

method Eff<A> lift <A> (Func<Task<Fin<A>>> f) Source #

Lift an effect into the Eff monad

method Eff<A> lift <A> (IO<A> ma) Source #

Lift an effect into the Eff monad

class Eff Source #